<?php
$link = mysql_connect("localhost","root");
mysql_select_db("inventario",$link);
$sql="select * from parametros where id=1";
$result = mysql_query($sql,$link);
if ($row = mysql_fetch_array($result)){
   $NumMov =  $row["ultmov"]+1;
   $sql = "update parametros set ultmov = '$NumMov' where id = 1";
   $result = mysql_query($sql,$link);
   $sql = "delete from movimientos where usuario='$novell_usuario' and tipo=0";
   $result = mysql_query($sql,$link);
}else {
   $NumMov = "0";
}
header("location: ../../index.php?psa_modulo=mod/ingresos/prueba.php&NumMov=$NumMov");
?>